<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <title>Thymeleaf tutorial: exercise 12</title>
        <link rel="stylesheet" href="../../../css/main-static.css" th:href="@{/css/main.css}" />
        <meta charset="utf-8" />
    </head>
    <body>
        <h1>Thymeleaf tutorial - Answer for exercise 12: forms</h1>
        <h2>Customer edition</h2>
        <!-- 
            Set the action to "/templates/exercise12/saveCustomer.html", and use
            th:object to bind the ${customer} variable as the form-backing bean. 
        -->
        <form method="post" action="saveCustomer.html">
            <!-- Set id here -->
            <input type="hidden" />
            
            <!-- Use th:field to show *{firstName} -->
            <label for="firstName">First name:</label>
            <input type="text" />
            
            <!-- Use th:field to show *{lastName} -->
            <label for="lastName">Last name:</label>
            <input type="text" />
            
            Genre:
            <!-- Iterate on ${genders} -->
            <div class="radio">
                <!-- Use th:field to check *{gender} -->
                <input type="radio" />
                <label>Male</label>
            </div>
            
            <label for="paymentMethod">Payment method:</label>
            <!-- Use th:field to select *{paymentMethod} -->
            <select>
                <!-- Iterate on ${paymentMethods} -->
                <option>Credit card</option>
            </select>
            
            <!-- Use th:field to show *{balance} -->
            <label for="balance">Balance (dollars):</label>
            <input type="text" />
            
            <input type="submit" />
        </form>
    </body>
</html>
